System Design: Google Maps

Understand the basics of a Google Maps system.

What is Google Maps?#

Let’s introduce the problem by assuming that we want to travel from one place to another. Here are the possible things that we might want to know:

  • What are the best possible paths that take us to our destination, depending on the vehicle type we’re using?
  • How long in miles is each path?
  • How much time does each path take to get us to our destination?

A maps application (like Google Maps or Apple Maps) enables users to answer all of the above questions easily. The following illustration shows the paths calculated by Google maps from “Los Angeles, USA” to “New York City, USA.”

Three paths suggested by Google maps for traveling from Los Angeles to New York

When do we use a maps service?#

Individuals and organizations rely on location data to navigate around the world. Maps help in these cases:

  • Individuals can find the locations of and directions to new places quickly, instead of wasting their time and the costs of travel, such as gas.
  • Individuals use maps to see their estimated time of arrival (ETA) and the shortest path based on current traffic data.
  • Many modern applications rely heavily on maps, such as ride-hailing services, autonomous vehicles, and hiking maps. For example:
    • Waymo’s self-driving car system uses Google Maps to navigate efficiently, quickly, and safely.
    • Uber uses Google Maps as part of its application to assist drivers and provide customers with a visual representation of their journey.
  • Routing and logistics-based companies reduce the time it takes to make deliveries. By using a map’s unique real-time and historical traffic data, it minimizes the overall cost of deliveries by reducing gas usage and time spent stuck in traffic.

In 2022, more than five million businesses are using Google Maps. It provides an API for enterprises to use a map system in their application.

It’s time to showcase your understanding! Challenge yourself and see how well you can identify different building blocks in Google Maps through our interactive assessment. Several building blocks can be considered for the system design of Google Maps. Recognize these building blocks based on the following requisite functionalities and provide your answers in the AI widget given below:

  • There is a need to search various locations on the map.

  • Storing metadata in the format of key-value pairs is essential for efficient data management.

  • The system should be adept at generating, handling events, and notifying other services when necessary.

  • To effectively represent road data, the system requires a structured graph format for storing and retrieving information.

You can challenge yourself to identify the building blocks without reading the functional and non-functional requirements given below as a hint.

Functional requirements

The functional requirements of our system are as follows.

  • Identify the current location: Users should be able to approximate their current location (latitude and longitude in decimal values) on the world map.
  • Recommend the fastest route: Given the source and destination (place names in text), the system should recommend the optimal route by distance and time, depending on the type of transportation.
  • Give directions: Once the user has chosen the route, the system should list directions in text format, where each item in the list guides the user to turn or continue in a specific direction to reach the destination.

The non-functional requirements of our system are as follows.

  • Availability: The system should be highly available.
  • Scalability: It should be scalable because both individuals and other enterprise applications like Uber and Lyft use Google Maps to find appropriate routes.
  • Less response time: It shouldn’t take more than two or three seconds to calculate the ETA and the route, given the source and the destination points.
  • Accuracy: The ETA we predict should not deviate too much from the actual travel time.
List four building blocks required for designing Google Maps.

Use separate lines for each building block and mention why it is needed.

How will we design Google Maps?#

We divide the design of Google Maps into five lessons:

  1. Requirements: In this lesson, we’ll list the functional and non-functional requirements of a Google Maps system. We will also identify the challenges involved in designing such a system. Lastly, we’ll estimate the resources like servers and bandwidth needed to serve queries by millions of users.
  2. Design: This lesson consists of the high-level and API design of a system like Google maps. We’ll describe the services and the workflow of the system.
  3. Meeting the challenges: We will discuss how we overcome the challenges that we highlighted in the requirements lesson.
  4. Detailed design: Based on the solution to the challenges, we will improve our earlier design and also elaborate on different aspects of it. We will describe the detailed design, including storage schema.
  5. Evaluation: This lesson explains how our designed Google Maps system fulfills all the requirements.

Let’s start by understanding the requirements for designing a system like Google Maps.

Evaluation of Quora’s Design

Requirements of Google Maps' Design